﻿--日程表
create table Calendar 
(
	ID			int primary key,
	[Name]		varchar(100) not null,
	TypeCode		int ,
	Content		varchar(500),
	StartTime	datetime,
	EndTime		datetime,
	InputTime	datetime default getdate(),
	CreatorID	int not null,
	CreatorName varchar(50),
	JoinerNames varchar(500),
	Addr		varchar(500),
	OtherJoiner varchar(100),
	IsPublic    bit,
	IsMsgRemind   bit,
)
go
create table CalDept
(
	CalID  int foreign key references Calendar(ID) on delete cascade,
	DeptID int foreign key references Dept(ID) on delete cascade
)
go
create table CalUser
(
	CalID  int foreign key references Calendar(ID) on delete cascade,
	UserID int foreign key references [User](ID) on delete cascade
)
go
